The previous code stopped working suddenly after I added iOS 15 simulator. Resetted Sonoma and reinstalled Xcode and couldn't make it work again. But it worked once and I decided to add a proper delay. New code is working every time now:
double delayInSeconds = 1.0; // set the delay time
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self readIssue:issue];
});
Post
Replies
Boosts
Views
Activity
Just found the solution - to push code for the opening of the selected document on the main thread. Now main view rotates before that document is opened:
dispatch_async(dispatch_get_main_queue(), ^{
[NSThread sleepForTimeInterval: 0.5];
[self readIssue:issue];
});
Here is a working code (part of the Baker Framework) where Newsstand's NSURLConnectionDownloadDelegate is replaced with NSURLSessionDownloadTask, thanks:
https://github.com/bakerframework/baker/issues/571
You would need to compare it with:
https://github.com/bakerframework/baker/blob/master/BakerShelf/BKRIssue.m
Thanks Quinn,
Have the same problem - download is started, goes to almost the very end and gives the error.
App didn't have data protection entitlement set.
But even after adding data protection entitlement and setting it to NSFileProtectionCompleteUntilFirstUserAuthentication nothing is changed.
Anything else to try, please?